package com.dddexplained.designbootcamp.ddd;

public enum LengthUnit {
    MM(1), CM(10), DM(100), M(1000);

    private int ratio;
    LengthUnit(int ratio) {
        this.ratio = ratio;
    }

    double convert(LengthUnit target, double value) {
        return value * ratio / target.ratio;
    }
}